#include "Socket.hpp"
#include "Common.hpp"
#include "EpollServer.hpp"
#include <memory>
#include <iostream>

using namespace Net_Work;

static const int gbacklog = 32;

void Usage(std::string process)
{
    std::cerr << "Usage: " << process << " port" << std::endl;
}


// ./main 8888
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }

    int port = std::stoi(argv[1]);
    EpollServer::ptr svr = std::make_shared<EpollServer>(port);
    svr->Loop();

    return 0;
}